package com.fang.async;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class MockQueue {

	private Logger logger = LoggerFactory.getLogger(getClass());

	private String startOrder;

	private String complateOrder;

	public String getStartOrder() {
		return startOrder;
	}

	public void setStartOrder(String startOrder){
		//模拟应用2中的一个单独线程处理的
		new Thread(() -> {
			logger.info("接到下单请求，" + startOrder);
			try {
				//进行逻辑的处理
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			this.complateOrder = startOrder;
			logger.info("下单请求处理完毕，" + startOrder);
		}).start();;

	}

	public String getComplateOrder() {
		return complateOrder;
	}

	public void setComplateOrder(String complateOrder) {
		this.complateOrder = complateOrder;
	}

}
